#ifndef __M_LOGMESSAGE_H__
#define __M_LOGMESSAGE_H__

#include <iostream>
#include <thread>
#include "Util.hpp"
#include "Level.hpp"

/*
    定义日志消息的所需要的内容
*/

namespace log
{
    struct LogMessage
    {
        using ptr = std::shared_ptr<LogMessage>;

        std::string _FileName;//文件名
        size_t _Line;//行数
        std::string _LogMessage;//日志信息
        size_t _ctime;//生成时间
        std::string _LogerName;
        std::thread::id _tid;//线程id
        LogLevel::Level _level;//日志等级

        LogMessage()
        {}

        LogMessage(std::string FileName,size_t Line,std::string LogMessage,LogLevel::Level level,std::string LogerName)
            :_FileName(FileName)
            ,_Line(Line)
            ,_LogMessage(LogMessage)
            ,_level(level)
            ,_ctime(Util::Data::GetTime())
            ,_tid(std::this_thread::get_id())
            ,_LogerName(LogerName)
        {}
    };
}

#endif